package com.hdax.dm.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hdax.dm.entity.scheduler.SchedulerSeat;
import com.hdax.dm.mapper.scheduler.SchedulerSeatMapper;
import com.hdax.dm.service.SchedulerSeatPService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SchedulerSeatPServiceImpl extends ServiceImpl<SchedulerSeatMapper, SchedulerSeat> implements SchedulerSeatPService {

    /*@Autowired
    private SchedulerSeatMapper schedulerSeatMapper;*/

    @Override
    public List<SchedulerSeat> getScheduleSeatList(Long schedulerId) {
        QueryWrapper<SchedulerSeat> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("scheduleId",schedulerId);
        return list(queryWrapper);
    }

    @Override
    public boolean updateSeatStatus(SchedulerSeat schedulerSeat) {
        return baseMapper.updateSeatStatus(schedulerSeat);
    }

    @Override
    public Long getScheduleSeatById(Long id) {
        return baseMapper.getScheduleSeatById(id);
    }

    @Override
    public List<SchedulerSeat> findSchedulerSeatByOrderNo(String orderNo) {
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.eq("orderNo",orderNo);
        return baseMapper.selectList(queryWrapper);
    }

    @Override
    public boolean updateSeatStatusSuccess(String orderNo, Integer type) {
        return baseMapper.updateSeatStatusSuccess(orderNo, type);
    }
}
